<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.sql.Connection"%>
<%@page import="com.yuxin.common.util.DBUtil"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Map"%>
<%
	Connection conn = null;
	// Init trader list
	List<Map<String, Object>> traderList = null;
	try{
		conn = DBUtil.getConnection();
		String sql = "select t.ID, t.NAME, t.LICENSE_IMG, t.CONTACT, t.PHONE, t.STATUS, DATE_FORMAT(t.CREATE_TIME, '%Y-%m-%d %H:%i') as CREATETIME from p_trade t where t.STATUS <> ?";
		traderList = DBUtil.queryList(conn, sql, "2");
	} catch (Exception ex) {
		ex.printStackTrace();
	} finally {
		DBUtil.close(conn);	
	}
%>
<!DOCTYPE html>
<html>
<head>
    <%@ include file="/meta.jsp" %>
    <title>${site_title}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
	<!--
		#prod_list td {text-align:center; vertical-align:middle;}
	-->
	</style>
</head>
<body>
<%@ include file="/header.jsp" %>
<div class="container" >
    <div class="row-fluid">
        <%@ include file="menu.jsp" %>
        <div class="span9">
           <table id="prod_list" class="table table-bordered" style="border: 1px solid #CCC; margin-top:20px;">
                <thead style="background-color: #CCCCCC;">
                    <tr>
                        <td width="200px">营业执照</td>
                        <td width="100px">负责人</td>
                        <td width="150px">联系电话</td>
                        <td width="120px">状态</td>
                        <td width="150px">申请时间</td>
                        <td width="50px"></td>
                    </tr>
                </thead>    
                <tbody>
                    <%
						if(traderList == null || traderList.size() == 0) {
							out.println("<tr><td  colspan='6'>暂无记录！</td></tr>");	
						}
                        for(Map<String, Object> map : traderList) {
                    %>
                    <tr>
                         <td>
                        	<img src="<%=request.getContextPath() %>/<%=map.get("LICENSE_IMG") %>" width="60" height="60" style="vertical-align:middle" />&nbsp;&nbsp;
							<%=map.get("NAME") %>
                        </td>	
                        <td><%=map.get("CONTACT") %></td>
                        <td><%=map.get("PHONE") %></td>
                        <td><%="1".equals(map.get("STATUS")) ? "待审核" : "2".equals(map.get("STATUS")) ? "审核通过" : "审核不通过" %></td>
                        <td><%=map.get("CREATETIME") %></td>
                        <td><a href="trader_detail.jsp?action=audit&amp;id=<%=map.get("ID") %>">详情</a></td>
                    </tr>
                    <%
                        }
                    %>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script>
$(document).ready(function(){
	$("#menu_trader_audit").addClass("active");
});
</script>
<%@ include file="/footer.jsp" %>
</body>
</html>